package com.itheima.admin.mapper;

import com.itheima.admin.DTO.LogDTO;
import com.itheima.admin.vo.logVO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;



/**
 * @Author: lqj
 * @Date: 2022/08/27/16:23
 * @Description:
 */
@Repository
public interface LogMapper {

    @Select("select t.id,\n" +
            "       t.user_id,\n" +
            "       t.name,\n" +
            "       t.password,\n" +
            "       t.nickname,\n" +
            "       t.image,\n" +
            "       t.phone,\n" +
            "       t.email,\n" +
            "       t.login_time\n" +
            "from ad_user t\n" +
            "where t.USER_ID = #{userId}  ")
    LogDTO selectUserInfo(@Param("userId") String userId);


    @Update("update ad_user  t set t.login_time = now() where t.USER_ID = #{userId}")
    void updateLoTime(@Param("userId") String userId);


    void insertUser(@Param("logDTO") LogDTO logDTO);
}
